package com.woniu.api;

import com.woniu.dto.HisCaseDto;
import com.woniu.dto.PageDTO;
import com.woniu.param.AddHisCaseParam;
import com.woniu.param.ListHisCaseParam;
import com.woniu.param.ModifyHisCaseParam;
import com.woniu.param.ModifyStatusHisCaseParam;
import com.woniu.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@FeignClient(
        contextId = "patient-1",
        value = "patient",
        path = "/patient"
)
@Api(tags = "病历表接口")
public interface HisCaseQueryApi {
    //生成一个病历
    @PostMapping("/addcase")
    @ApiOperation("生成一个病历")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "addHisCaseParam",value = "病历表信息不包含ID",required = false,
//                    dataType = "AddHisCaseParam")
//    })
    Result<HisCaseDto> generateMedicalRecords(@RequestBody AddHisCaseParam addHisCaseParam);

    //根据患者ID修改病历
    @PutMapping("modifycase")
    @ApiOperation("根据患者ID修改病历")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "modifyHisCaseParam",value = "病历表信息包含ID",required = false,
//                    dataType = "ModifyHisCaseParam")
//    })
    Result<HisCaseDto> modifyMedicalRecords(@RequestBody ModifyHisCaseParam modifyHisCaseParam);

    //完结病历将病历状态修改
    @ApiOperation("完结病历将病历状态修改")
    @PutMapping("modifycasestats")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "modifyStatusHisCaseParam",value = "病历ID,病历状态，病历完结时间",required = false,
//                    dataType = "ModifyStatusHisCaseParam")
//    })
    Result<HisCaseDto> modifyMedicalRecordStatus(@RequestBody ModifyStatusHisCaseParam modifyStatusHisCaseParam);

    //根据病历ID集合删除ID
    @ApiOperation("根据病历ID集合删除ID")
    @DeleteMapping("deletecase")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "ids",value = "病历ID集合",required = false,
//                    dataType = "ArrayList")
//    })
    Result<Boolean> deleteMedicalRecord(@RequestParam("ids") ArrayList<Integer> ids);

    //根据条件查询病历
    @GetMapping("getcase")
    @ApiOperation("根据条件查询病历")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "listHisCaseParam",value = "病历条件信息",required = false,
//                    dataType = "ListHisCaseParam")
//    })
    Result<PageDTO<HisCaseDto>> queryMedicalRecords(@RequestBody ListHisCaseParam listHisCaseParam);


}
